package com.example.demo.model.widget;

import com.deepzero.mmma.ser.JsonMapper;
import lombok.SneakyThrows;

import java.util.List;

/**
 * @author liuzhenchuan@foxmail.com
 * @date 2021/1/10
 */
public class Parser {

    @SneakyThrows
    public static void main(String[] args) {
        JsonMapper mapper = new JsonMapper();
        List<Group> groupList = mapper.fromJsons(data,Group.class);
        System.out.println(groupList);
    }

    static final String data = "[\n" +
            "  {\n" +
            "    categoryKey: \"process\",\n" +
            "    categoryLabel: \"数据源\",\n" +
            "    components: [\n" +
            "      {\n" +
            "        marketingCategory: \"process\",\n" +
            "        marketingNodeIcon: \"iconkehuqunzu\",\n" +
            "        marketingNodeScreenName: \"客户群组\",\n" +
            "        marketingNodeType: \"segmentSource\"\n" +
            "      },\n" +
            "      {\n" +
            "        marketingCategory: \"process\",\n" +
            "        marketingNodeIcon: \"icontedinghangwei\",\n" +
            "        marketingNodeScreenName: \"特定行为\",\n" +
            "        marketingNodeType: \"specific_behavior\"\n" +
            "      }\n" +
            "    ]\n" +
            "  },\n" +
            "  {\n" +
            "    categoryKey: \"condition\",\n" +
            "    categoryLabel: \"执行动作\",\n" +
            "    components: [\n" +
            "      {\n" +
            "        marketingCategory: \"condition\",\n" +
            "        marketingNodeIcon: \"icondingshi\",\n" +
            "        marketingNodeScreenName: \"开始\",\n" +
            "        marketingNodeType: \"startEvent\",\n" +
            "      },\n" +
            "      {\n" +
            "        marketingCategory: \"condition\",\n" +
            "        marketingNodeIcon: \"iconjieshu\",\n" +
            "        marketingNodeScreenName: \"结束\",\n" +
            "        marketingNodeType: \"endEvent\",\n" +
            "      },\n" +
            "      {\n" +
            "        marketingCategory: \"condition\",\n" +
            "        marketingNodeIcon: \"icondingshidengdai\",\n" +
            "        marketingNodeScreenName: \"定时/等待\",\n" +
            "        marketingNodeType: \"waiting\"\n" +
            "      },\n" +
            "      {\n" +
            "        marketingCategory: \"condition\",\n" +
            "        marketingNodeIcon: \"iconbceshi\",\n" +
            "        marketingNodeScreenName: \"A/B测试\",\n" +
            "        marketingNodeType: \"ABTest\"\n" +
            "      },\n" +
            "      {\n" +
            "        marketingCategory: \"condition\",\n" +
            "        marketingNodeIcon: \"iconduanxin\",\n" +
            "        marketingNodeScreenName: \"发送短信\",\n" +
            "        marketingNodeType: \"message\"\n" +
            "      },\n" +
            "      {\n" +
            "        marketingCategory: \"condition\",\n" +
            "        marketingNodeIcon: \"iconfasongyoujian\",\n" +
            "        marketingNodeScreenName: \"发送邮件\",\n" +
            "        marketingNodeType: \"send_email\"\n" +
            "      },\n" +
            "      {\n" +
            "        marketingCategory: \"condition\",\n" +
            "        marketingNodeIcon: \"iconapptuisong\",\n" +
            "        marketingNodeScreenName: \"APP推送\",\n" +
            "        marketingNodeType: \"app_push\"\n" +
            "      },\n" +
            "      {\n" +
            "        marketingCategory: \"condition\",\n" +
            "        marketingNodeIcon: \"iconxiaochengxu\",\n" +
            "        marketingNodeScreenName: \"小程序\",\n" +
            "        marketingNodeType: \"mini_program\"\n" +
            "      },\n" +
            "      {\n" +
            "        marketingCategory: \"condition\",\n" +
            "        marketingNodeIcon: \"icontuwenxinxi\",\n" +
            "        marketingNodeScreenName: \"图文消息\",\n" +
            "        marketingNodeType: \"serviceTask_sendWechat\"\n" +
            "      },\n" +
            "      {\n" +
            "        marketingCategory: \"condition\",\n" +
            "        marketingNodeIcon: \"iconmobanxiaoxi\",\n" +
            "        marketingNodeScreenName: \"模版消息\",\n" +
            "        marketingNodeType: \"serviceTask_sendWechatTemplate\"\n" +
            "      },\n" +
            "      {\n" +
            "        marketingCategory: \"condition\",\n" +
            "        marketingNodeIcon: \"iconjiarufenqun1\",\n" +
            "        marketingNodeScreenName: \"加入分群\",\n" +
            "        marketingNodeType: \"join_audience\"\n" +
            "      },\n" +
            "      {\n" +
            "        marketingCategory: \"condition\",\n" +
            "        marketingNodeIcon: \"iconyichufenqun\",\n" +
            "        marketingNodeScreenName: \"移出分群\",\n" +
            "        marketingNodeType: \"remove_audience\"\n" +
            "      },\n" +
            "      {\n" +
            "        marketingCategory: \"condition\",\n" +
            "        marketingNodeIcon: \"icontianjiabiaoqian\",\n" +
            "        marketingNodeScreenName: \"添加标签\",\n" +
            "        marketingNodeType: \"add_tag\"\n" +
            "      },\n" +
            "      {\n" +
            "        marketingCategory: \"condition\",\n" +
            "        marketingNodeIcon: \"iconyichubiaoqian\",\n" +
            "        marketingNodeScreenName: \"移除标签\",\n" +
            "        marketingNodeType: \"remove_tag\"\n" +
            "      }\n" +
            "    ]\n" +
            "  },\n" +
            "  {\n" +
            "    categoryKey: \"notification\",\n" +
            "    categoryLabel: \"判断分流\",\n" +
            "    components: [\n" +
            "      {\n" +
            "        marketingCategory: \"notification\",\n" +
            "        marketingNodeIcon: \"iconshijianpanduan1\",\n" +
            "        marketingNodeScreenName: \"事件判断\",\n" +
            "        marketingNodeType: \"parallel\"\n" +
            "      },\n" +
            "      {\n" +
            "        marketingCategory: \"notification\",\n" +
            "        marketingNodeIcon: \"iconshuxingpanduan1\",\n" +
            "        marketingNodeScreenName: \"属性判断\",\n" +
            "        marketingNodeType: \"attributeBranch\"\n" +
            "      },\n" +
            "      {\n" +
            "        marketingCategory: \"notification\",\n" +
            "        marketingNodeIcon: \"iconbiaoqianpanduan1\",\n" +
            "        marketingNodeScreenName: \"标签判断\",\n" +
            "        marketingNodeType: \"tag_judg\"\n" +
            "      },\n" +
            "      {\n" +
            "        marketingCategory: \"notification\",\n" +
            "        marketingNodeIcon: \"iconmoxingpanduan\",\n" +
            "        marketingNodeScreenName: \"模型判断\",\n" +
            "        marketingNodeType: \"model_judg\"\n" +
            "      },\n" +
            "      {\n" +
            "        marketingCategory: \"notification\",\n" +
            "        marketingNodeIcon: \"iconhangweipanduan\",\n" +
            "        marketingNodeScreenName: \"行为判断\",\n" +
            "        marketingNodeType: \"action_judg\"\n" +
            "      }\n" +
            "    ]\n" +
            "  },\n" +
            "  {\n" +
            "    categoryKey: \"condition\",\n" +
            "    categoryLabel: \"数据分析\",\n" +
            "    components: [\n" +
            "      {\n" +
            "        marketingCategory: \"condition\",\n" +
            "        marketingNodeIcon: \"iconliushikehuzhaohui\",\n" +
            "        marketingNodeScreenName: \"转化目标\",\n" +
            "        marketingNodeType: \"transform_target\"\n" +
            "      },\n" +
            "      {\n" +
            "        marketingCategory: \"condition\",\n" +
            "        marketingNodeIcon: \"iconcost\",\n" +
            "        marketingNodeScreenName: \"短信费用\",\n" +
            "        marketingNodeType: \"sms_fee\"\n" +
            "      }\n" +
            "    ]\n" +
            "  }\n" +
            "]";
}
